package com.isoft.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 用户表
 * @TableName DM_USER
 */
@TableName(value ="DM_USER")
@Data
public class DmUser implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Integer ID;

    /**
     * 用户名
     */
    private String USERNAME;

    /**
     * 密码
     */
    private String PASSWORD;

    /**
     * 年龄
     */
    private Integer AGE;

    /**
     * 邮箱
     */
    private String EMAIL;

    /**
     * 地址
     */
    private String ADDRESS;

    /**
     * 手机号
     */
    private String PHONE;

    /**
     * 性别
     */
    private String SEX;

    /**
     * 生日
     */
    private Date BIRTHDAY;

    @TableField(exist = false)
    private String token;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DmUser other = (DmUser) that;
        return (this.getID() == null ? other.getID() == null : this.getID().equals(other.getID()))
                && (this.getUSERNAME() == null ? other.getUSERNAME() == null : this.getUSERNAME().equals(other.getUSERNAME()))
                && (this.getPASSWORD() == null ? other.getPASSWORD() == null : this.getPASSWORD().equals(other.getPASSWORD()))
                && (this.getAGE() == null ? other.getAGE() == null : this.getAGE().equals(other.getAGE()))
                && (this.getEMAIL() == null ? other.getEMAIL() == null : this.getEMAIL().equals(other.getEMAIL()))
                && (this.getADDRESS() == null ? other.getADDRESS() == null : this.getADDRESS().equals(other.getADDRESS()))
                && (this.getPHONE() == null ? other.getPHONE() == null : this.getPHONE().equals(other.getPHONE()))
                && (this.getSEX() == null ? other.getSEX() == null : this.getSEX().equals(other.getSEX()))
                && (this.getBIRTHDAY() == null ? other.getBIRTHDAY() == null : this.getBIRTHDAY().equals(other.getBIRTHDAY()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getID() == null) ? 0 : getID().hashCode());
        result = prime * result + ((getUSERNAME() == null) ? 0 : getUSERNAME().hashCode());
        result = prime * result + ((getPASSWORD() == null) ? 0 : getPASSWORD().hashCode());
        result = prime * result + ((getAGE() == null) ? 0 : getAGE().hashCode());
        result = prime * result + ((getEMAIL() == null) ? 0 : getEMAIL().hashCode());
        result = prime * result + ((getADDRESS() == null) ? 0 : getADDRESS().hashCode());
        result = prime * result + ((getPHONE() == null) ? 0 : getPHONE().hashCode());
        result = prime * result + ((getSEX() == null) ? 0 : getSEX().hashCode());
        result = prime * result + ((getBIRTHDAY() == null) ? 0 : getBIRTHDAY().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", ID=").append(ID);
        sb.append(", USERNAME=").append(USERNAME);
        sb.append(", PASSWORD=").append(PASSWORD);
        sb.append(", AGE=").append(AGE);
        sb.append(", EMAIL=").append(EMAIL);
        sb.append(", ADDRESS=").append(ADDRESS);
        sb.append(", PHONE=").append(PHONE);
        sb.append(", SEX=").append(SEX);
        sb.append(", BIRTHDAY=").append(BIRTHDAY);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}